Release 10.1A: OpenEdge Development:
Programming Interfaces
Converting nonstandard input files
The input files used in the previous examples contained data that was in a very specific format:
When using a data file as an input source, Progress, by default, expects that file to conform to the following standards:
What if you need to deal with an input file that does not conform to these standards? For example, you might have a file in which each field is on a separate line; or where fields are separated by commas instead of spaces; or where the fields have no special delimiters, but appear at specific column locations.
Progress provides two strategies for dealing with such files:
Which method you choose depends on your particular circumstances. For example:
- The frame-based statements, such as
SET, validate the format of the incoming data;IMPORTdoes not. In some cases you want this validation and in others you might not want it.- If you expect to read the same file repeatedly, preprocessing that file once with
QUOTERmight be worthwhile. However, if your code reads from different files, or the content of the file is subject to change, you might want to avoid repeated preprocessing by usingIMPORTinstead.The following section explains how to use the
IMPORTstatement, for information about the QUOTER utility, see Appendix E "Command and Utility Reference."
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |